package com.cheyun.netsalev3.view.choosecity

import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProviders
import com.cheyun.netsalev3.R
import com.cheyun.netsalev3.adapter.HomePageAdapter
import com.cheyun.netsalev3.databinding.ActivityChooseCityBinding
import com.cheyun.netsalev3.utils.BaseActivity
import com.cheyun.netsalev3.utils.InjectorUtils
import com.cheyun.netsalev3.viewmodel.ChooseCityActivityViewModel

class ChooseCityActivity : BaseActivity<ActivityChooseCityBinding>() {
    override fun initContentView(): Int {
        return R.layout.activity_choose_city
    }

    override fun initViewModel(): ViewModel? {
        var factory = InjectorUtils.getChooseCityActivityViewModelFactory()
        return ViewModelProviders.of(this, factory).get(ChooseCityActivityViewModel::class.java)
    }

    private var listFragmet = ArrayList<Fragment>()
    override fun initView() {
        listFragmet.add(ChooseCityFragment1())
        listFragmet.add(ChooseCityFragment2.newInstance("1"))
        listFragmet.add(ChooseCityFragment2.newInstance("2"))
        binding.viewPager.offscreenPageLimit = 3
        binding.viewPager.adapter = HomePageAdapter(supportFragmentManager, listFragmet)

    }

    override fun initData() {
    }


}
